package com.xdhl.fu.flight.info.api;

import com.xdhl.fu.common.core.constant.SecurityConstants;
import com.xdhl.fu.common.core.constant.ServiceNameConstants;
import com.xdhl.fu.common.core.domain.R;
import com.xdhl.fu.flight.info.api.factory.RemoteFlightInfoFallbackFactory;
import com.xdhl.fu.flight.info.api.mongodb.domain.MGFlightSchedule;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;

/**
 * 航班信息服务
 *
 * @author 朱力维
 * @time 2022/6/12 21:06
 */
@FeignClient(contextId = "remoteFlightInfoService", value = ServiceNameConstants.FLIGHT_INFO_SERVICE, fallbackFactory =
        RemoteFlightInfoFallbackFactory.class)
public interface RemoteFlightInfoService {

    /**
     * 获取航班信息
     *
     * @param dataId 获取航班信息
     * @return 航班信息
     */
    @GetMapping(value = "/info/getInfoInnerAuth/{dataId}")
    R<MGFlightSchedule> getInfoInnerAuth(@PathVariable("dataId") String dataId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

}
